package com.jayqqaa12.system.controller;

import com.jayqqaa12.jbase.jfinal.ext.ctrl.JsonController;
import com.jayqqaa12.system.model.Bug;
import com.jfinal.ext.route.ControllerBind;
import com.jfinal.plugin.spring.Inject;

@ControllerBind(controllerKey = "/system/bug")
public class BugCtrl extends JsonController<Bug>
{
	@Inject.BY_TYPE
	Bug bugDao;

	public void list()
	{
		sendJson("list", bugDao.list());
	}

	public void status()
	{
		renderJsonResult(getModel().updateAndModifyDate());
	}   

	public void add()
	{
		renderJsonResult(getModel().saveAndCreateDate());
	}

	public void edit()
	{
		renderJsonResult(getModel().updateAndModifyDate());

	}

	public void delete()
	{
		renderJsonResult(bugDao.deleteById(getPara("id")));
	}

}
